package com.itheima.Controller;

import com.itheima.pojo.LogQueryParam;
import com.itheima.pojo.PageResult;
import com.itheima.pojo.Result;
import com.itheima.service.OperateLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/log")

public class LogController {
    @Autowired
    private OperateLogService operateLogService;

    //    该接口用于日志信息的分页查询
    @GetMapping("/page")
    public Result log(LogQueryParam logQueryParam) {
        log.info("分页查询日志信息：{}", logQueryParam);
        PageResult pageResult = operateLogService.pageQuery(logQueryParam);
        return Result.success(pageResult);

    }
}
